var n = getApp();

Page({
    data: {
        userInfo: {},
        xingbie: "欢迎您！",
        hasUserInfo: !1,
        canIUse: wx.canIUse("button.open-type.getUserInfo"),
        tipsShow: !1,
        tipsValue: null,
        FirstStart: !0
    },
    GetConfig: function() {
        wx.request({
            method: "GET",
            url: "https://api.oddfar.com/g/run/?",
            success: function(n) {
                if (1 === n.data.tipscode) {
                    var t = n.data.tips;
                    wx.showModal({
                        title: t.title,
                        content: t.msg,
                        cancelText: t.left,
                        confirmText: t.right,
                        success: function(n) {
                            n.confirm && console.log("用户点击了确定按钮"), n.cancel && console.log("用户点击了取消按钮");
                        }
                    });
                }
            }
        });
    },
    GetUserInfo: function() {
        var t = this;
        n.globalData.userInfo ? this.setData({
            userInfo: n.globalData.userInfo,
            hasUserInfo: !0
        }) : this.data.canIUse ? n.userInfoReadyCallback = function(n) {
            t.setData({
                userInfo: n.userInfo,
                hasUserInfo: !0
            });
        } : wx.getUserInfo({
            success: function(e) {
                n.globalData.userInfo = e.userInfo, t.setData({
                    userInfo: e.userInfo,
                    hasUserInfo: !0
                });
            }
        });
    },
    getUserInfo: function(t) {
        console.log(t), n.globalData.userInfo = t.detail.userInfo, this.setData({
            userInfo: t.detail.userInfo,
            hasUserInfo: !0
        }), 1 === userInfo.gender ? this.setData({
            usergender: "帅气的小哥哥"
        }) : 2 === userInfo.gender && this.setData({
            usergender: "美丽的小姐姐"
        });
    },
    linkFefu: function() {
        wx.setClipboardData({
            data: "airymz.com",
            success: function() {
                wx.showToast({
                    title: "微信号已复制，请自行搜索添加",
                    icon: "none"
                });
            }
        });
    },
    linkQQ: function() {
        wx.setClipboardData({
            data: "airymz.com",
            success: function() {
                wx.showToast({
                    title: "QQ群号已复制，请自行搜索添加",
                    icon: "none"
                });
            }
        });
    },
    MustSee: function() {
        wx.navigateTo({
            url: "mustsee/mustsee"
        });
    },
    AboutMe: function() {
        wx.navigateTo({
            url: "aboutme/aboutme"
        });
    },
    AboutIt: function() {
        wx.navigateTo({
            url: "aboutit/aboutit"
        });
    },
    onLoad: function() {
        this.GetUserInfo(), this.GetConfig();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});